package com.example.tractorframework.helloworld;

import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.tractorframework.core.receptor.IViewReceptor;
import com.tractorframework.core.receptor.ViewReceptorBase;

public class ClickReceptor extends ViewReceptorBase implements IViewReceptor{

	private Button bt;
	
	
	private void onBtClick()
	{
		Toast.makeText(bt.getContext(), "hello clicked", Toast.LENGTH_SHORT).show();
	}


	@Override
	protected void onStartOverride(View view) {
		Toast.makeText(view.getContext(), "click receptor started", Toast.LENGTH_SHORT).show();
		bt.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View arg0) {
				onBtClick();
			}
		});
	}

	@Override
	protected void onStopOverride(View view) {
		Toast.makeText(view.getContext(), "click receptor stopped", Toast.LENGTH_SHORT).show();
	}

}
